home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4628 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.8 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.lang.eiffel
  4. Subject: Re: Hungarian notation
  5. Date: Wed, 31 Jan 96 12:11:16 GMT
  6. Organization: none
  7. Message-ID: <823090276snz@genesis.demon.co.uk>
  8. References: <30C40F77.53B5@swsbbs.com> <4dtv3gINNo9u@keats.ugrad.cs.ubc.ca> <4e5k6o$aci@grid.direct.ca> <4ej0ds$sju@rational.rational.com> <4em1ptINNn1@keats.ugrad.cs.ubc.ca>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4em1ptINNn1@keats.ugrad.cs.ubc.ca>
  15.            c2a192@ugrad.cs.ubc.ca "Kazimir Kylheku" writes:
  16.  
  17. >Right. To make a truly abstract data type for, say, time_t, one would have to
  18. >hide the fact that it is an integer (the inessential aspect)
  19.  
  20. The C language makes no guarantee that time_t is an integer.
  21.  
  22. >and provide
  23. >abstract operations for manipulating this type, such as functions to convert
  24. >some other date breakdwon into time_t, for calculating the difference between
  25. >two time_t's and such.
  26.  
  27. That is precisely what the standard library does (localtime(), mktime(),
  28. difftime() etc.). The program never needs to know what the internal
  29. representation of time_t is. Your general point stands, you just picked
  30. a bad/debatable example.
  31.  
  32. >I still maintain my point that typedefs are not necessary for good coding in C.
  33. >The aliasing for which they are useful can just as easily be accomplished with
  34. >pre-processor macros.
  35.  
  36. Only in the simplest cases. They also help with debugging where the debugger
  37. is aware of typedef names.
  38.  
  39. -- 
  40. -----------------------------------------
  41. Lawrence Kirby | fred@genesis.demon.co.uk
  42. Wilts, England | 70734.126@compuserve.com
  43. -----------------------------------------
  44.